home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / mus / misc / maplay1_2.lha / maplay / subband_layer_1.h < prev    next >
C/C++ Source or Header  |  1994-06-23  |  3KB  |  90 lines

  1. /*
  2.  *  @(#) subband_layer_1.h 1.6, last edit: 6/15/94 16:51:58
  3.  *  @(#) Copyright (C) 1993, 1994 Tobias Bading (bading@cs.tu-berlin.de)
  4.  *  @(#) Berlin University of Technology
  5.  *
  6.  *  This program is free software; you can redistribute it and/or modify
  7.  *  it under the terms of the GNU General Public License as published by
  8.  *  the Free Software Foundation; either version 2 of the License, or
  9.  *  (at your option) any later version.
  10.  *
  11.  *  This program is distributed in the hope that it will be useful,
  12.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  *  GNU General Public License for more details.
  15.  *
  16.  *  You should have received a copy of the GNU General Public License
  17.  *  along with this program; if not, write to the Free Software
  18.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  */
  20.  
  21. #ifndef SUBBAND_LAYER_1_H
  22. #define SUBBAND_LAYER_1_H
  23.  
  24. #include "all.h"
  25. #include "subband.h"
  26. #include "crc.h"
  27.  
  28.  
  29. // class for layer I subbands in single channel mode:
  30. class SubbandLayer1 : public Subband
  31. {
  32. protected:
  33.   uint32 subbandnumber;
  34.   uint32 samplenumber;
  35.   uint32 allocation;
  36.   real     scalefactor;
  37.   uint32 samplelength;
  38.   real     sample;
  39.   real     factor, offset;
  40.  
  41. public:
  42.        SubbandLayer1 (uint32 subbandnumber);
  43.   void read_allocation (Ibitstream *, Header *, Crc16 *);
  44.   void read_scalefactor (Ibitstream *, Header *);
  45.   bool read_sampledata (Ibitstream *);
  46.   bool put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *);
  47. };
  48.  
  49.  
  50. // class for layer I subbands in joint stereo mode:
  51. class SubbandLayer1IntensityStereo : public SubbandLayer1
  52. {
  53. protected:
  54.   real channel2_scalefactor;
  55.  
  56. public:
  57.        SubbandLayer1IntensityStereo (uint32 subbandnumber);
  58.   void read_allocation (Ibitstream *stream, Header *header, Crc16 *crc)
  59.   {
  60.     SubbandLayer1::read_allocation (stream, header, crc);
  61.   }
  62.   void read_scalefactor (Ibitstream *, Header *);
  63.   bool read_sampledata (Ibitstream *stream)
  64.   {
  65.     return SubbandLayer1::read_sampledata (stream);
  66.   }
  67.   bool put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *);
  68. };
  69.  
  70.  
  71. // class for layer I subbands in stereo mode:
  72. class SubbandLayer1Stereo : public SubbandLayer1
  73. {
  74. protected:
  75.   uint32 channel2_allocation;
  76.   real     channel2_scalefactor;
  77.   uint32 channel2_samplelength;
  78.   real     channel2_sample;
  79.   real     channel2_factor, channel2_offset;
  80.  
  81. public:
  82.        SubbandLayer1Stereo (uint32 subbandnumber);
  83.   void read_allocation (Ibitstream *, Header *, Crc16 *);
  84.   void read_scalefactor (Ibitstream *, Header *);
  85.   bool read_sampledata (Ibitstream *);
  86.   bool put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *);
  87. };
  88.  
  89. #endif
  90.